package CollectionTask;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionTest1 {
    public static void main(String[] args) {
        /*Collection c=new ArrayList();
        c.add("注册");
        c.add("登录");
        c.add("修改密码");
        c.add("注销");
        boolean b=c.add("注册");
        System.out.println(b);
        System.out.println(c);
        System.out.println("size:"+c.size());
        System.out.println("是否为空集");
        c.clear();
        System.out.println("集合已清空");
        System.out.println(c);
        System.out.println("size:"+c.size());
        System.out.println("是否为空集:"+c.isEmpty());*/

        Collection c=new ArrayList();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        boolean b=c.add("five");
        System.out.println(b);
        System.out.println(c);
        System.out.println("size:"+c.size());
        System.out.println("是否为空集");
        c.clear();
        System.out.println("集合已清空");
        System.out.println(c);
        System.out.println("size:"+c.size());
        System.out.println("是否为空集:"+c.isEmpty());


    }
}
